from numpy import loadtxt
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense

# load the dataset
dataset = loadtxt('train.csv', delimiter=',')
# split into input (X) and output (y) variables
X = dataset[:, 0:15]
y = dataset[:, 16]


# define the keras model
model = Sequential()
model.add(Dense(12, input_shape=(15,), activation='relu'))
model.add(Dense(8, activation='relu'))
model.add(Dense(1, activation='sigmoid'))


# compile the keras model
model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy'])

res = model.fit(X, y, epochs=150, batch_size=10)

# evaluate the keras model
# _, accuracy = model.evaluate(X, y)
# print('Accuracy: %.2f' % (accuracy*100))

print(model.history)
